# $Id: Makefile 15 2009-01-19 02:21:28Z vic.fryzel $

JAVA = java
JAVAC = javac
CLASSPATH = .:./pj2.jar

.SUFFIXES: .java .class
.java.class:
	$(JAVAC) -classpath $(CLASSPATH) $<
SOURCES = Parser.java
CLASSES = Parser.class

all: package pj2 $(CLASSES)

# Since Parser.java is an auto generated file, ensure it's in the parser
# package
package:
	sed -i -e "N;s/package parser;\n//g" Parser.java
	sed -i -e "s/\/\/ created by jay/package parser;\n\/\/ created by jay/g" Parser.java

pj2:
	if [ ! -e pj2.jar ]; then \
		wget -N http://www.cs.rit.edu/~ats/projects/lp2/pj2/pj2.jar; \
	fi
	
clean:
	rm -Rf *.class pj2.jar
